import request from '@/utils/request'

// 查询销售申请列表
export function listSaleRequest(query) {
  return request({
    url: '/xiaoshou/saleRequest/list',
    method: 'get',
    params: query
  })
}
export function addDetail(addDto) {
  return request({
    url: '/xiaoshou/saleRequestDetail/addDetail',
    method: 'get',
    params: addDto
  })
}
export function getAllCus() {
  return request({
    url: '/basedata/customer/getAllCus',
    method: 'get',
  })
}
export function updDetail(updDto) {
  return request({
    url: '/xiaoshou/saleRequestDetail/updDetail',
    method: 'post',
    data: updDto
  })
}
export function addOrder(addOrderDto) {
  return request({
    url: '/xiaoshou/saleRequest/addOrder',
    method: 'post',
    data: addOrderDto
  })
}
export function saleRequestList(orderId) {
  return request({
    url: '/xiaoshou/saleRequestDetail/'+orderId,
    method: 'get',
  })
}

// 查询销售申请详细
export function getSaleRequest(id) {
  return request({
    url: '/xiaoshou/saleRequest/' + id,
    method: 'get'
  })
}

// 新增销售申请
export function addSaleRequest(data) {
  return request({
    url: '/xiaoshou/saleRequest',
    method: 'post',
    data: data
  })
}

// 修改销售申请
export function updateSaleRequest(data) {
  return request({
    url: '/xiaoshou/saleRequest',
    method: 'put',
    data: data
  })
}

// 删除销售申请
export function delSaleRequest(id) {
  return request({
    url: '/xiaoshou/saleRequest/' + id,
    method: 'delete'
  })
}
